package com.Lishuai;

import com.Lishuai.Mapper.BookMapper;
import com.Lishuai.Mapper.UserMapper;
import com.Lishuai.Pojo.Book;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import java.util.ArrayList;
import java.util.List;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:applicationContext.xml")
public class Test {
    @Autowired
    private UserMapper userMapper;
    @Autowired
    private BookMapper bookMapper;
    @org.junit.Test
    public void m(){
        Book book1 = new Book();
        book1.setName("西游记");
        System.out.println(bookMapper.sekect(book1));
    }
    @org.junit.Test
    public void m1(){
        PageHelper.startPage(2, 2);
        List<Book> all = bookMapper.findAll();
        PageInfo<Book> pageInfo = new PageInfo<>(all);
        System.out.println(pageInfo);

    }
}
